package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.WellControlB229;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class WellControlB229Converter implements AttributeConverter<WellControlB229, String> {
    @Override
    public String convertToDatabaseColumn(WellControlB229 wellControlB229) {
        return JSONUtil.toJsonStr(wellControlB229);
    }

    @Override
    public WellControlB229 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, WellControlB229.class);
    }
}
